home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
SHELLS
/
TPSHELL
/
SUBPROC.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1986-05-23
|
1KB
|
34 lines
{ This program calls COMMAND.COM to interpret whatever command
is given in its parameter string.
It can be used to execute a .BAT file from inside another .BAT file.
It uses the include file SHELL.PAS to handle the DOS interface.
It also demonstrates a nice trick for getting the entire parameter
string as one string by looking in DOS's area.
*** NOTE 1 *** SET, PROMPT, and PATH commands will not work.
*** NOTE 2 *** To compile this you must set the options to limit
the total amount of of heap storage ("free dynamic memory")
used by this program so some memory will be left for the command.
$40 paragraphs (1K) is sufficient for this very simple program. }
{ This program was written by:
Bill Mayne
9707 Lawndale Dr.
Silver Spring, MD 20901
(301)899-4845 (answering machine) }
program subproc;
{$I shell }
var
i:integer;
cmdstr:ShellStr; {defined as string[127] by the include}
begin
move(Mem[CSeg:$81],cmdstr,128); {get parameter string from DOS}
shell(cmdstr,i);
Halt(i);
end.